<div class="pageFormContent" layoutH="20">
	<div class="unit">
		<p>
			<label>我的待审核:</label>
			<a href="myself/contentList.html?status=2" title="<i class='icon-book icon-large'></i> 我的内容" target="navTab" rel="myself/contentList">
				<@_contentList advanced=true status=2 userId=admin.id>
					${page.totalCount}篇
				</@_contentList>
			</a>
		</p>
		<p>
			<label>我的草稿:</label>
			<a href="myself/contentList.html?status=0" title="<i class='icon-book icon-large'></i> 我的内容" target="navTab" rel="myself/contentList">
				<@_contentList advanced=true status=0 userId=admin.id>
					${page.totalCount}篇
				</@_contentList>
			</a>
		</p>
		<p>
			<a class="button" href="main.html" target="navTab" rel="main">刷新</a>
		</p>
	</div>
	<div class="divider"></div>
	<div class="unit">
		<p>
			<label>登录次数:</label>
			<a href="myself/logLogin.html" title="<i class='icon-signin icon-large'></i> 我的登陆日志" target="navTab" rel="myself/logLogin">${admin.loginCount}</a>
		</p>
		<p>
			<label>上次登录日期:</label>
			<a href="myself/logLogin.html" title="<i class='icon-signin icon-large'></i> 我的登陆日志" target="navTab" rel="myself/logLogin">${admin.lastLoginDate!}</a>
		</p>
		<p>
			<label>上次登录IP:</label>
			<a href="myself/logLogin.html" title="<i class='icon-signin icon-large'></i> 我的登陆日志" target="navTab" rel="myself/logLogin">${admin.lastLoginIp!}</a>
		</p>
	</div>
	<div class="divider"></div>
	<div class="unit">
		<p>
			<label>静态站点地址:</label><a href="${(site.sitePath?html)!}" target="_blank">${(site.sitePath?html)!}</a>
		</p>
		<p>
			<label>动态站点地址:</label><a href="${(site.dynamicPath?html)!}" target="_blank">${(site.dynamicPath?html)!}</a>
		</p>
		<p>
			<label>资源文件地址:</label><a href="${(site.resourcePath?html)!}" target="_blank">${(site.resourcePath?html)!}</a>
		</p>
	</div>
	<div class="divider"></div>
<@_masterSite>
	<div class="unit">
		<p id="memory" style="width:380px;height:200px;"></p>
		<p id="memory_count" style="width:380px;height:200px;"></p>
		<p id="disk" style="width:380px;height:200px;"></p>
	</div>
<script>
<@_memory>
var memoryChart={
	chart:echarts.init(document.getElementById('memory')),
	countChart:echarts.init(document.getElementById('memory_count')),
	data:{
		freeMemory:[],
		usedMemory:[],
		unUsedMemory:[]
	},
	time:[],
	toDecimal:function(number) {  
        var value = parseFloat(number);  
        if (isNaN(value)) {  
            return 0;  
        }  
        value = Math.round(number*100)/100;  
        return value;  
    }  
};
memoryChart.time.push("${.now?string('hh:mm')}");
memoryChart.data.freeMemory.push(memoryChart.toDecimal(${freeMemory}/1048576));
memoryChart.data.usedMemory.push(memoryChart.toDecimal((${totalMemory}-${freeMemory})/1048576));
memoryChart.data.unUsedMemory.push(memoryChart.toDecimal((${maxMemory}-${totalMemory})/1048576));
memoryChart.chart.setOption({
	title: {
        text: '内存监测'
    },
    tooltip : {
        trigger: 'axis'
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: memoryChart.time
    },
    yAxis: {
        type: 'value'
    },
    series: [
    {
   	    name:'实际使用',
   	    type:'line',
   	    stack: '总量',
   	    areaStyle: {normal: {}},
   	    data:memoryChart.data.usedMemory
   	},
   	{
   	    name:'闲置内存',
   	    type:'line',
   	    stack: '总量',
   	    areaStyle: {normal: {}},
   	    data:memoryChart.data.freeMemory
   	},
   	{
   	    name:'可用剩余',
   	    type:'line',
   	    stack: '总量',
   	    areaStyle: {normal: {}},
   	    data:memoryChart.data.unUsedMemory
   	}]
});
memoryChart.countChart.setOption({
	title : {
        text: '内存使用(最大可用:${(maxMemory/1048576)?string("0.##")}MB)',
        subtext: '占用内存:${(totalMemory/1048576)?string("0.##")}MB',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)",
        position: [10, 10]
    },
    series : [
        {
            name: '内存使用',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
                {value:${((totalMemory-freeMemory)/1048576)?string("0.##")}, name:'已用'},
                {value:${(freeMemory/1048576)?string("0.##")}, name:'闲置'}
            ]
        }
    ]
});
if(window.memoryInterval){
	clearInterval(window.memoryInterval);
}
window.memoryInterval=setInterval(function () {
	$.getJSON("common/memory.html", function(data) {
		memoryChart.time.push(data.time);
		memoryChart.data.freeMemory.push(memoryChart.toDecimal(data.freeMemory/1048576));
		memoryChart.data.usedMemory.push(memoryChart.toDecimal((data.totalMemory-data.freeMemory)/1048576));
		memoryChart.data.unUsedMemory.push(memoryChart.toDecimal((data.maxMemory-data.totalMemory)/1048576));
		if(memoryChart.time.length > 100){
			memoryChart.time.shift();
			memoryChart.data.freeMemory.shift();
			memoryChart.data.usedMemory.shift();
			memoryChart.data.unUsedMemory.shift();
		}
		memoryChart.countChart.setOption({
			title:{
				subtext: '占用内存:'+memoryChart.toDecimal(data.totalMemory/1048576)+'MB'
			},
			series: [{
	             name: '内存使用',
	             type: 'pie',
	             radius : '55%',
	             center: ['50%', '60%'],
	             data:[
	                 {value:memoryChart.toDecimal((data.totalMemory-data.freeMemory)/1048576), name:'已用'},
	                 {value:memoryChart.toDecimal(data.freeMemory/1048576), name:'闲置'}
	             ]
	         }]
		});
		memoryChart.chart.setOption({
	        xAxis: {
	            data: memoryChart.time
	        },
	        series: [
	    	{
	    	    name:'实际使用',
	    	    type:'line',
	    	    stack: '总量',
	    	    areaStyle: {normal: {}},
	    	    data:memoryChart.data.usedMemory
	    	},
	    	{
	    	    name:'闲置内存',
	    	    type:'line',
	    	    stack: '总量',
	    	    areaStyle: {normal: {}},
	    	    data:memoryChart.data.freeMemory
	    	},
	    	{
	    	    name:'可用剩余',
	    	    type:'line',
	    	    stack: '总量',
	    	    areaStyle: {normal: {}},
	    	    data:memoryChart.data.unUsedMemory
	    	}]
	    });
	});
	$("#background,#progressBar").hide();
}, 20000);
</@_memory>
<@_disk>
echarts.init(document.getElementById('disk')).setOption({
	title : {
        text: '站点磁盘:${(totalSpace/1048576)?string("0.##")}MB',
        subtext: '${(rootPath?js_string)!}',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)",
        position: [10, 10]
    },
    series : [
        {
            name: '磁盘空间',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
                {value:${((totalSpace-freeSpace)/1048576)?string("0.##")}, name:'已用'},
                {value:${(freeSpace/1048576)?string("0.##")}, name:'空闲'}
            ]
        }
    ]
});
</@_disk>
</script>
	<div class="divider"></div>
<@_systemProperties>
	<div class="unit">
		<p>
			<label>操作系统:</label>${.vars['os.name']!}(${.vars['os.arch']!})
		</p>
		<p>
			<label>操作系统版本:</label>${.vars['os.version']!}
		</p>
		<p>
			<label>操作系统用户:</label>${.vars['user.name']!}
		</p>
		<p>
			<label>操作系统时区:</label>${.vars['user.timezone']!}
		</p>
		<p>
			<label>文件编码:</label>${.vars['file.encoding']!}
		</p>
	</div>
	<div class="divider"></div>
	<div class="unit">
		<p>
			<label>JRE名称:</label>${.vars['java.runtime.name']!}
		</p>
		<p>
			<label>JRE版本:</label>
			${.vars['java.runtime.version']!}(${.vars['java.vm.info']!})
		</p>
		<p>
			<label>JVM名称:</label>${.vars['java.vm.name']!}
		</p>
		<p>
			<label>JVM版本:</label>${.vars['java.vm.version']!}
		</p>
	</div>
	<div class="divider"></div>
	<div class="unit">
		<p>
			<label>用户目录:</label>${.vars['user.home']!}
		</p>
		<p>
			<label>工作目录:</label>${.vars['user.dir']!}
		</p>
		<p>
			<label>临时文件目录:</label>${.vars['java.io.tmpdir']!}
		</p>
		<p>
			<label>文件分隔符:</label>${.vars['file.separator']!}
		</p>
	</div>
	<div class="divider"></div>
</@_systemProperties>
</@_masterSite>
<@_version>
	<div class="unit">
		<p id="cmsVersion">
			<label>Public CMS:</label>
			<a href="http://www.publiccms.com/" target="_blank">${cms}</a>
			(<a href="http://opensource.org/licenses/MIT" target="_blank">The MIT License</a>)
		</p>
	<@_masterSite>
		<p>
			<label>节点ID:</label>
			${cluster}
		</p>
		<p>
			<label>节点属性:</label>
			${master?string('管理节点','[普通节点]')}
		</p>
		<script>
			$.getJSON('http://cms.publiccms.com/api/directive/version?callback=?',function(data){
				if($('#cmsVersion a').eq(0).text()!==data.cms){
					$('#cmsVersion a').eq(0).append('[<em style="color:red">有新版本</em>]');
				}
			});
		</script>
	</@_masterSite>
	</div>
	<div class="divider"></div>
</@_version>
</div>